/*
 * Controller.h
 *
 *  Created on: 22 янв. 2013
 *      Author: alex
 */

#ifndef CONTROLLER_H_
#define CONTROLLER_H_


#include "IOdometry.h"
#include "Point.h"
#include "OccupancyGrid.h"


using namespace std;

class Controller
{
public:
	virtual ~Controller();
	static Controller* instance();
	void setOdometryModule(IOdometry* odometry);
	void setTile(const Tile& tile);
	void setStart(const Tile& tile);
	void setAngle(double Angle);
	const Point& Position() const{return position;}

	Tile getTile() {return OccupancyGrid::instance()->RealToLogical(position);}
	const Tile& start() const {return _start;}
	void goTo(const Tile& tile);

	void goHome();
private:
	static Controller* _instance;
	IOdometry* _odometry;
	Point position;
	Tile _start;
	Controller();
	void goToStraight(Point& dest);

};

#endif /* CONTROLLER_H_ */



